POV-Ray : Newsgroups : povray.programming : float literal quesion : float literal quesion Server Time
3 Jul 2024 05:51:28 EDT (-0400)
  float literal quesion  
From: Wolfgang Wieser
Date: 29 Nov 2003 08:47:05
Message: <3fc8a358@news.povray.org>
Is there any reason to use
  a/=2.0;
instead of
  a*=0.5;
in case a is a float or double variable?

After all, 0.5 has an exact representation as float (being 
1 * 2^-1). On current CPUs, the latter is faster by a factor 
of three, IIRC. 

Wolfgang


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.